/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package sda.levelup.swing;

import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.WindowConstants;

/**
 *
 * @author Дима
 */
public class MyFrame extends JFrame
{
        private Toolkit t = Toolkit.getDefaultToolkit();
        private Dimension d = t.getScreenSize();
        private int R = 200;
        private double x0 = d.getWidth()/2;
        private double y0 = d.getHeight()/2;    
    
    public MyFrame() {
        setupFrame();
        fillFrame();
    }
    
    public void setupFrame(){
        setTitle("Buttons");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setSize(400, 400);
        /*Toolkit t = Toolkit.getDefaultToolkit();
        Dimension d = t.getScreenSize();
        int coordX = d.width / 2;
        int coordY = d.height / 2;
        setBounds(coordX, coordY, 400, 400); */           
    }
    public void fillFrame(){
        ButtonPanel bp = new ButtonPanel();
        //SinCosPanel scp = new SinCosPanel();
        add(bp);        
    }
    
    public int getOX(double i){
        return (int)(x0+R*Math.cos(Math.toRadians(i)));
    }
    public int getOY(double i){
        return (int)(x0+R*Math.sin(Math.toRadians(i)));
    }
}
